/*
 *
1 + 2i
3 + 4i
4 + 6i
3 + 4i

 */

#include <iostream>
using namespace std;
class Complex{
	private:
		double r;
		double i;
	public:
		Complex(double r, double i){
			this->r = r;
			this->i = i;
		}
		void print(void){
			cout << r << " + " << i << "i" << endl;
		}
		const Complex operator+(const Complex& c){
			Complex tmp(r+c.r, i+c.i);
			return tmp;
		}
		friend const Complex operator-(const Complex& l , const Complex& r);
};
const Complex operator-(const Complex& l, const Complex& r){
	Complex tmp(l.r - r.r, l.i - r.i);
	return tmp;
}
int main(void){
	Complex a(1,2);
	Complex b(3,4);
	a.print();
	b.print();

	Complex c = a+b;// a.operator+(b); 
	c.print();
	
	Complex d = c - a; // operator-(c, a);
	d.print();
	return 0;
}
